package com.ls.lserp.modules.job.service;

import java.sql.SQLException;
import java.text.DateFormat;
import java.text.DecimalFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.alibaba.fastjson.JSON;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.ls.lserp.common.utils.DateUtils;
import com.ls.lserp.common.utils.ResourcesUtil;
import com.ls.lserp.common.utils.StringUtils;
import com.ls.lserp.dbaccess.Dao.AccountingEntityMapper;
import com.ls.lserp.dbaccess.Dao.CustomerFitCountMapper;
import com.ls.lserp.dbaccess.Dao.MaterialEntityMapper;
import com.ls.lserp.dbaccess.Dao.OrderEntityMapper;
import com.ls.lserp.dbaccess.Dao.StyleCostEntityMapper;
import com.ls.lserp.dbaccess.Dao.StyleEntityMapper;
import com.ls.lserp.dbaccess.Dao.StyleFitEntityMapper;
import com.ls.lserp.dbaccess.Dao.StyleOptionEntityMapper;
import com.ls.lserp.dbaccess.Dao.WPaymentEntityMapper;
import com.ls.lserp.dbaccess.Entity.AccountingEntity;
import com.ls.lserp.dbaccess.Entity.AccountingMtmEntity;
import com.ls.lserp.dbaccess.Entity.AccountingOrderEntity;
import com.ls.lserp.dbaccess.Entity.CustomerFitCount;
import com.ls.lserp.dbaccess.Entity.MaterialCustomEntity;
import com.ls.lserp.dbaccess.Entity.OrderEntity;
import com.ls.lserp.dbaccess.Entity.StyleDesignHistoryEntity;
import com.ls.lserp.dbaccess.Entity.StyleEntity;
import com.ls.lserp.dbaccess.Entity.StyleFitEntity;
import com.ls.lserp.dbaccess.Entity.StyleOptionREntity;
import com.ls.lserp.modules.common.entity.UploadFile;
import com.ls.lserp.modules.job.entity.OrderSyncJobCache;
import com.ls.lserp.modules.order.entity.StyleCostEntity;
import com.ls.lserp.modules.sys.entity.WeiXinPushMessageEntity;
import com.ls.lserp.modules.sys.utils.CommonWeChat;
import com.ls.lserp.dbaccess.Entity.WPaymentEntity;

/**
 * @ClassName : DataBaseSyncService
 * @Description : ERP与平台数据同步 a_designoption_p
 * @author : zhigang.gao
 * @date : 2017年9月21日
 */
@Service
@Transactional(readOnly = false)
public class OrderSyncService {

	private final Logger logger = LoggerFactory.getLogger(this.getClass());

	@Autowired
	private OrderEntityMapper orderEntityMapper;// o_order_p 定制订单表

	@Autowired
	private StyleEntityMapper styleEntityMapper;// s_style_p 定制款式表

	@Autowired
	private StyleFitEntityMapper styleFitEntityMapper;// s_style_fit_r 定制量尺表

	@Autowired
	private StyleOptionEntityMapper styleOptionEntityMapper;// s_style_option_r
																													// 定制设计项目表

	@Autowired
	private StyleCostEntityMapper styleCostEntityMapper;// s_style_cost_s 定制设计费用表

	@Autowired
	private MaterialEntityMapper materialEntityMapper;// i_material_customer_p
																										// 自带面料表
	
	@Autowired
	private CustomerFitCountMapper customerFitCountMapper;// MTM表
	
	@Autowired
	private AccountingEntityMapper accountingEntityMapper;// 交易表（平台）
	
	@Autowired
	private WPaymentEntityMapper wPaymentEntityMapper;

	/**
	 * @Title : findAllList
	 * @Description : 取得平台最新数据
	 * @return
	 * @throws Exception
	 * @return : List<OrderSyncJobCache>
	 *
	 * @author : shaoyun.tan
	 * @date : 2017年9月21日
	 */
	public List<OrderSyncJobCache> findAllList(OrderSyncJobCache orderSyncJobCache,String orderStatus) throws Exception {
		// 取得当前订单日期
        String[] strmd = DateUtils.getDate("yyyy-MM-dd").split("-");
		// 订单
		OrderEntity orderEntity = new OrderEntity();
		orderEntity.setCreateDate(orderSyncJobCache.getDateTime());
		orderEntity.setOrderStatusCd(orderStatus);
		// 款式
		StyleEntity styleEntity = new StyleEntity();
		// 款式量体
		StyleFitEntity styleFitEntity = new StyleFitEntity();
		// 款式项目
		StyleOptionREntity styleOptionREntity = new StyleOptionREntity();
		// 设计费用
		StyleCostEntity styleCostEntity = new StyleCostEntity();
		// 所有订单数据集
		List<OrderSyncJobCache> cloudList = new ArrayList<>();
		// 一个客户下的所有订单数据
		OrderSyncJobCache orderSyncJobCache2 = new OrderSyncJobCache();
		List<OrderSyncJobCache> cloudList2 = new ArrayList<>();
		// 一条订单下的所有相关数据
		OrderSyncJobCache orderSyncJobCache3 = new OrderSyncJobCache();
		// 订单集
		List<OrderEntity> orderList;
		// 款式集
		//List<StyleEntity> styleList;
		// 款式量体集
		//List<StyleFitEntity> styleFitList;
		// 款式项目集
		List<StyleOptionREntity> styleOptionList;
		//
		List<String> accountingList = null;
		//
		AccountingMtmEntity accountingMtmEntity = null;
		String codeFormat = "%02d";
		// 当天订单的所有客户
		List<OrderEntity> customList = orderEntityMapper.findCustomList(orderEntity);
		if (customList != null && customList.size() > 0) {
			for (int i = 0; i < customList.size(); i++) {
				// 一个客户下的所有订单
				orderEntity.setOgnizationId(customList.get(i).getOgnizationId());
				orderEntity.setOrderStatusCd(orderStatus);
				orderList = orderEntityMapper.findAllList(orderEntity);
				if (orderList != null && orderList.size() > 0) {
					for (int j = 0; j < orderList.size(); j++) {
						// 设置订单状态为生产中
						orderList.get(j).setOrderStatusCd(ResourcesUtil.getConfig("Workshop_30"));
			            // 计算预计交付日
			            Date targetDate = DateUtils.getTargerDate(Integer.parseInt(strmd[0].toString()),
			                    Integer.parseInt(strmd[1].toString()), Integer.parseInt(strmd[2].toString()), 7);
			            orderList.get(j).setTargetDate(targetDate);
						//更新平台订单数据
						//updateOrderStatusMTM(orderList.get(j));
						// 一条订单下的所有相关数据
						if (orderList.get(j).getMaterialSource() == 1) {
							styleEntity = styleEntityMapper.getCustom((long) orderList.get(j).getStyleId());
						} else {
							styleEntity = styleEntityMapper.get((long) orderList.get(j).getStyleId());
						}
						// 设置客户尺码名称
						if (styleEntity != null) {
							CustomerFitCount customerFitCount =  customerFitCountMapper.getCustomerFitCount(styleEntity.getCustomerCountId());
							if (customerFitCount != null) {
								orderList.get(j).setCustomerName(customerFitCount.getCustomerName());
								orderList.get(j).setCustomName(customerFitCount.getCustomerName());
								orderList.get(j).setSex(customerFitCount.getSex());
							}
						}
						styleFitEntity = styleFitEntityMapper.get((long) orderList.get(j).getStyleId());
						styleOptionREntity.setSysStyleId((long) orderList.get(j).getStyleId());
						styleOptionList = styleOptionEntityMapper.findAllList(styleOptionREntity);
						styleCostEntity = styleCostEntityMapper.get((long) orderList.get(j).getStyleId());
						orderSyncJobCache3.setOrderEntity(orderList.get(j));
						orderSyncJobCache3.setStyleEntity(styleEntity);
						orderSyncJobCache3.setStyleFitEntity(styleFitEntity);
						orderSyncJobCache3.setStyleOptionList(styleOptionList);
						orderSyncJobCache3.setStyleCostEntity(styleCostEntity);
						// 获取交易号及交易单订单数量
						accountingList = accountingEntityMapper.findDataListByBusinessNo(styleEntity.getStyleBarCode());
						if (accountingList != null && accountingList.size() > 0) {
							orderSyncJobCache3.setBusinessNo(accountingList.get(0));
							orderSyncJobCache3.setAccountingOrderSize(String.valueOf(accountingList.size()));
							accountingMtmEntity = accountingEntityMapper.getAccountingInfoByBusinessNo(accountingList.get(0));
							if (accountingMtmEntity != null) {
								// 设置收货地址信息
								orderSyncJobCache3.setAddresseeName(accountingMtmEntity.getAddresseeName());
								orderSyncJobCache3.setAddresseeTel(accountingMtmEntity.getAddresseeTel());
								orderSyncJobCache3.setAddressProvinceCd(accountingMtmEntity.getAddressProvinceCd());
								orderSyncJobCache3.setAddressCityCd(accountingMtmEntity.getAddressCityCd());
								orderSyncJobCache3.setAddressDistrict(accountingMtmEntity.getAddressDistrict());
								orderSyncJobCache3.setAddressDetail(accountingMtmEntity.getAddressDetail());
								orderSyncJobCache3.setZipCode(accountingMtmEntity.getZipCode());
							}
						}
						if (orderList.get(j).getOrderNumber().intValue() > 1) {
							for (int k = 0; k < orderList.get(j).getOrderNumber().intValue(); k++) {
			            		OrderSyncJobCache orderSyncJobCache3_clone = orderSyncJobCache3.clone();
			            		System.out.println(orderSyncJobCache3+"--"+orderSyncJobCache3.getOrderEntity());
			            		System.out.println(orderSyncJobCache3_clone+"--"+orderSyncJobCache3_clone.getOrderEntity());
			            		orderSyncJobCache3_clone.getOrderEntity().setOrderNo(orderSyncJobCache3_clone.getOrderEntity().getOrderNo() + "-" + String.format(codeFormat, (k + 1)));
			            		cloudList2.add(orderSyncJobCache3_clone);
			            	}
						}else {
							
							cloudList2.add(orderSyncJobCache3);
						}
						
						orderSyncJobCache3 = new OrderSyncJobCache();
					}
					orderSyncJobCache2.setOgnizationId((long) customList.get(i).getOgnizationId());
					orderSyncJobCache2.setOgnizationShortName(customList.get(i).getCustomName());
					orderSyncJobCache2.setCloudList(cloudList2);
					cloudList.add(orderSyncJobCache2);
					cloudList2 = new ArrayList<>();
					orderSyncJobCache2 = new OrderSyncJobCache();
				}
			}
		}

		return cloudList;
	}

	/**
	 * @Title : updateOrderStatusMTM
	 * @Description : 更新一条平台订单数据
	 * @return
	 * @throws SQLException
	 * @return : List<OrderSyncJobCache>
	 *
	 * @author : shaoyun.tan
	 * @date : 2017年11月09日
	 */
	public void updateOrderStatusMTM(OrderEntity orderEntity) throws SQLException {
		orderEntity.preUpdate();
		orderEntityMapper.updateAllOrderStatusMTM(orderEntity);

	}
	
	/**
	 * @Title : updateAllOrderStatusMTM
	 * @Description : 更新平台订单状态
	 * @return
	 * @throws SQLException
	 *
	 * @author : shaoyun.tan
	 * @date : 2017年11月09日
	 */
	public void updateAllOrderStatusMTM(List<OrderSyncJobCache> cloudList) throws SQLException {
		if (cloudList != null && cloudList.size() > 0) {
			for (OrderSyncJobCache orderSyncJobCache : cloudList) {
				if (orderSyncJobCache != null) {
					for (OrderSyncJobCache childEntity : orderSyncJobCache.getCloudList()) {
						//更新一条平台订单数据
						updateOrderStatusMTM(childEntity.getOrderEntity());
					}
				}
			}
		}
	}

	/**
	 * @Title : findCustomMaterialList
	 * @Description : 获取平台自带面料数据
	 * @return
	 * @throws SQLException
	 * @return : List<MaterialCustomEntity>
	 *
	 * @author : shaoyun.tan
	 * @date : 2017年11月09日
	 */
	public List<MaterialCustomEntity> findCustomMaterialList(MaterialCustomEntity materialEntity) throws SQLException {
		return materialEntityMapper.findCustomMaterialList(materialEntity);

	}
	
	/**
	 * @Title : updateCustomMaterialStatus
	 * @Description : 更新自带面料状态
	 * @return
	 * @throws SQLException
	 *
	 * @author : shaoyun.tan
	 * @date : 2017年11月09日
	 */
	public void updateCustomMaterialStatus(List<MaterialCustomEntity> materialList) throws SQLException {
		if (materialList != null && materialList.size() > 0) {
			for (int i = 0; i < materialList.size(); i++) {
				materialEntityMapper.updateStatus(materialList.get(i));
			}
		}
	}

	/**
	 * @Title : insertCustomMaterial
	 * @Description : 同步平台自带面料数据
	 * @return
	 * @throws SQLException
	 *
	 * @author : shaoyun.tan
	 * @date : 2017年11月09日
	 */
	public void insertCustomMaterial(List<MaterialCustomEntity> materialList) throws SQLException {
		// 获取平台自带面料数据
		// List<MaterialCustomEntity> materialList = findCustomMaterialList(new
		// MaterialCustomEntity());
		// 切换ERP数据库，保存自带面料数据
		// DataSourceContextHolder.setDbType(DataSourceContextHolder.DATA_SOURCE_ZYSQL);
		if (materialList != null && materialList.size() > 0) {
			for (int i = 0; i < materialList.size(); i++) {
				UploadFile uploadFile = new UploadFile();
				if (materialList.get(i).getFilePath() != null && !"".equals(materialList.get(i).getFilePath())) {
					uploadFile = new UploadFile();
					uploadFile.preInsert();
					// 图片来源：1.电脑端 ,2.手机端
					uploadFile.setFileSource(1L);
					// 所在模块区分（1:需求单 2:款式 3:订单 4:测试 5:工艺图片）
					uploadFile.setModuleKbn(4L);
					// ftp文件名
					uploadFile.setFtpFile("/material");
					// 上传文件
					uploadFile.setUploadFile(materialList.get(i).getUploadFile());
					// 上传文件路径
					uploadFile.setFilePath(materialList.get(i).getFilePath());
					// 保存自带面料图片数据
					materialEntityMapper.saveUploadFileCustom(uploadFile);
				}
				materialList.get(i).setMaterialFileId(uploadFile.getFileId());
				materialList.get(i).preInsert();
				// 保存自带面料
				materialEntityMapper.insertCustomMaterial(materialList.get(i));
			}
		}
		// 切换MTM数据库,更新自带面料状态
		/*
		 * DataSourceContextHolder.setDbType(DataSourceContextHolder.
		 * DATA_SOURCE_MTMSQL); if (materialList != null && materialList.size() > 0)
		 * { for (int i = 0; i < materialList.size(); i++) {
		 * materialEntityMapper.updateStatus(materialList.get(i)); } }
		 */
	}

	/**
	 * @Title : insertCustomMaterial
	 * @Description : 同步平台自带面料数据
	 * @return
	 * @throws SQLException
	 *
	 * @author : shaoyun.tan
	 * @date : 2017年11月09日
	 */
	public void updateCusMaterialStatus(List<MaterialCustomEntity> materialList) throws SQLException {
		if (materialList != null && materialList.size() > 0) {
			for (int i = 0; i < materialList.size(); i++) {
				materialEntityMapper.updateStatus(materialList.get(i));
			}
		}
	}
	
	/**
	 * @Title : findAccountingList
	 * @Description : 取得平台已付款交易数据
	 * @return
	 * @throws Exception
	 * @return : List<AccountingMtmEntity>
	 *
	 * @author : shaoyun.tan
	 * @date : 2018年11月26日
	 */
	public List<AccountingMtmEntity> findAccountingList(String accountStatus) throws Exception {
		//
		List<AccountingMtmEntity> accountingMtmList = accountingEntityMapper.findAccountListByStatus(accountStatus);
		//
		return accountingMtmList;
	}
	
	/**
	 * 
	 * @param syncStatus
	 * @param deliveryStatus
	 * @return
	 * @throws Exception
	 */
	public List<AccountingOrderEntity> findAccountingOrderList(String syncStatus,String deliveryStatus) throws Exception {
		//
		return accountingEntityMapper.findAccountListOrder(syncStatus,deliveryStatus);
	}
	
	/**
	 * @Title : findRelevantAccountingList
	 * @Description : 获取导入的订单的相关交易单信息
	 * @return
	 * @throws Exception
	 * @return : List<AccountingMtmEntity>
	 *
	 * @author : shaoyun.tan
	 * @date : 2018年11月26日
	 */
	public List<AccountingMtmEntity> findRelevantAccountingList() throws Exception {
		//
		return accountingEntityMapper.findImportOrdersRelevantAccountInfo();
	}
	
	/**
	 * @Title : updateAccountingExpressInfo
	 * @Description : 更新交易单快递信息
	 * @return
	 * @throws Exception
	 *
	 * @author : shaoyun.tan
	 * @date : 2018年11月26日
	 */
	public void updateAccountingExpressInfo(List<AccountingMtmEntity> accountingMtmShippedList) throws Exception {
		Date nowTime = new Date();
		OrderEntity orderEntity = null;
		List<Long> orderIds = null;
		AccountingMtmEntity accountingMtmEntity = null;
		if (accountingMtmShippedList != null && accountingMtmShippedList.size() > 0) {
			for (AccountingMtmEntity aMtmEntity : accountingMtmShippedList) {
				accountingMtmEntity = accountingEntityMapper.getAccountingInfoByBusinessNo(aMtmEntity.getBusinessNo());
				if (accountingMtmEntity != null && (accountingMtmEntity.getExpressNo() == null 
						|| "".equals(accountingMtmEntity.getExpressNo()))) {
					//
					accountingEntityMapper.updataAccountingExpressNo(aMtmEntity);
					//
					orderIds = accountingEntityMapper.findOrderIdListByBusinessNo(aMtmEntity.getBusinessNo());
					if (orderIds != null && orderIds.size() > 0) {
						for (Long orderId : orderIds) {
							orderEntity = new OrderEntity();
							if (orderId != null) {
								orderEntity.setOrderId(orderId.intValue());
								orderEntity.setOrderStatusCd(ResourcesUtil.getConfig("Transit_55"));
								orderEntity.setUpdateDate(nowTime);
								orderEntity.setUpdateUser(1);
								orderEntityMapper.updateProducingOrderStatusMTM(orderEntity);
							}
						}
					}
					// 发货消息推送
					sendNoticeMsg(aMtmEntity.getBusinessNo(), CommonWeChat.TEMPLATE_ID_EXPRESS);
				}
			}
		}
	}
	
	/**
	 * 同步已付款交易单数据
	 * @param accountingMtmList
	 * @throws Exception
	 */
	public void insertAccountingOfPaid(List<AccountingMtmEntity> accountingMtmList) throws Exception {
		if (accountingMtmList != null && accountingMtmList.size() > 0) {
			Map<String, AccountingMtmEntity> map = new HashMap<String, AccountingMtmEntity>();
			List<AccountingMtmEntity> accountingErpDataList = accountingEntityMapper.findAccountListByStatus("");
			if (accountingErpDataList != null && accountingErpDataList.size() > 0) {
				for(AccountingMtmEntity erpData :accountingErpDataList){
					map.put(erpData.getBusinessNo(), erpData);
				}
			}
			for (int i = 0; i < accountingMtmList.size(); i++) {
				if (map.get(accountingMtmList.get(i).getBusinessNo()) == null) {
					accountingEntityMapper.insertAccountEntity(accountingMtmList.get(i));
				}
			}
		}
	}
	
	/**
	 * 同步已付款交易单数据
	 * @param
	 * @throws Exception
	 */
	public void insertAccountingOrder(List<AccountingOrderEntity> accountingOrderList) throws Exception {
		logger.info("accountingOrderList:"+JSON.toJSONString(accountingOrderList));
		if (accountingOrderList != null && accountingOrderList.size() > 0) {
			for (int i = 0; i < accountingOrderList.size(); i++) {
				try{
				accountingEntityMapper.insertAccountingOrder(accountingOrderList.get(i));
				}catch (Exception e) {
					logger.info("accountingOrderList.get(i):"+JSON.toJSONString(accountingOrderList.get(i)));
				}

				}
			}
		}

	
	/**
	 * 同步已付款交易单数据
	 * @param oldSyncStatus 旧同步状态
	 * @param deliveryStatus 发货状态
	 * @param newSyncStatus 新同步状态
	 * @throws Exception
	 */
	public void updateAccountingOrder(String oldSyncStatus,String deliveryStatus,String newSyncStatus) throws Exception {
		accountingEntityMapper.updateAccountingOrder(oldSyncStatus,deliveryStatus,newSyncStatus);
	}
	
	/**
	 * 同步已付款交易单数据
	 * @param
	 * @throws Exception
	 */
	public void updateAccountingOrder(List<AccountingOrderEntity> accountingOrderList) throws Exception {
		if (accountingOrderList != null && accountingOrderList.size() > 0) {
			for (int i = 0; i < accountingOrderList.size(); i++) {
				accountingEntityMapper.updateOrderDeliveryInfo(accountingOrderList.get(i));
			}
		}
	}
	
	/**
	 * 生产中消息推送
	 * @param relevantAccountingMtmList
	 * @throws ParseException
	 */
	public void sendProductingNoticeMsg(List<AccountingMtmEntity> relevantAccountingMtmList) throws ParseException{
		List<AccountingMtmEntity> tempList = null;
		if (relevantAccountingMtmList != null && relevantAccountingMtmList.size() > 0) {
			for (AccountingMtmEntity aEntity : relevantAccountingMtmList) {
				// 获取该交易号下已投入生产的订单集
				tempList = accountingEntityMapper.findOrderOfProductingByBusinessNo(aEntity);
				// 交易单下若未有已生成订单，则推送消息
				if (tempList == null || tempList.size() == 0) {
					sendNoticeMsg(aEntity.getBusinessNo(), CommonWeChat.TEMPLATE_ID_PRODUCTING);
				}
			}
		}
	}
	
	/**
	 * 消息推送
	 * @param businessNo
	 * @throws ParseException
	 */
	public void sendNoticeMsg(String businessNo, String template_id) throws ParseException {
		//
		WeiXinPushMessageEntity dataInfo = new WeiXinPushMessageEntity();
		AccountingMtmEntity accountingEntity = accountingEntityMapper.getAccountingInfoByBusinessNo(businessNo);
		WPaymentEntity wPaymentEntity = wPaymentEntityMapper.selectData(businessNo);
		if (accountingEntity != null && wPaymentEntity != null) {
			// 模板基础数据
			dataInfo.setOpenId(wPaymentEntity.getOpenId());
			dataInfo.setTemplate_id(template_id);
			dataInfo.setFormId(wPaymentEntity.getPrepayId());
			// 生产通知
			if (CommonWeChat.TEMPLATE_ID_PRODUCTING.equals(template_id)) {
				// 推送消息数据
				dataInfo.setKeyword_1(accountingEntity.getBusinessNo());
				dataInfo.setKeyword_2(wPaymentEntity.getBody());
				dataInfo.setKeyword_3("专属定制，专注你的每一个细节（预计定制时间10~15天）");
				// 小程序跳转路径
				dataInfo.setPageUrl("pages/user/order?status=2");
			// 发货通知
			}else if (CommonWeChat.TEMPLATE_ID_EXPRESS.equals(template_id)) {
				// 推送消息数据
				dataInfo.setKeyword_1(accountingEntity.getExpressNo());
				dataInfo.setKeyword_2(accountingEntity.getBusinessNo());
				dataInfo.setKeyword_3("顺丰物流");
				if (accountingEntity.getShippmentDate() == null) {
					dataInfo.setKeyword_4(DateUtils.formatDate(new Date(), "yyyy-MM-dd HH:mm"));
				}else {
					dataInfo.setKeyword_4(DateUtils.formatDate(accountingEntity.getShippmentDate(), "yyyy-MM-dd HH:mm"));
				}
				dataInfo.setKeyword_5(StringUtils.checkStringNull(accountingEntity.getAddressProvinceCd())
									+StringUtils.checkStringNull(accountingEntity.getAddressCityCd())
									+StringUtils.checkStringNull(accountingEntity.getAddressDistrict())
									+StringUtils.checkStringNull(accountingEntity.getAddressDetail()));
				dataInfo.setKeyword_6(accountingEntity.getAddresseeName());
				dataInfo.setKeyword_7(accountingEntity.getAddresseeTel());
				dataInfo.setKeyword_8("卖家已发货，请注意查收！");
				// 小程序跳转路径
				dataInfo.setPageUrl("pages/user/order?status=3");
			}
			// 执行消息推送
			CommonWeChat.noticeMessage(dataInfo);
		}
		
	}

}
